package start.spring.basic.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;

/**
 * 
 * ****************************************************************************
 * Mybatis Plus配置
 *
 * @author(作者)：xuyongyun	
 * @date(创建日期)：2020年4月9日
 ******************************************************************************
 */
@EnableTransactionManagement
@Configuration
public class MybatisPlusConfig {
	
	/**
     * 分页插件
     */
	@Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
		MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
		interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
		return interceptor;
    }
    
}
